import { computed, ref, watch, watchEffect } from 'vue';
import routerData, { type ListMenu } from '@/index.ts';
import useCounter from "@/stores/counter.ts"
import router from '@/router/indext.ts'
const path = ref<string>("")
const isCollapse = ref(true)
const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
const useCounterState = computed(() => {
    return useCounter()
})
useCounterState.value.menuList = routerData
// const router = useCounterState.value.appRouter
function toPath(path: any) {
    path.value = path.path
    router.push(path.path)
    // console.log( path.value);

}
export default {
    handleOpen,
    handleClose,
    isCollapse,
    menuList: useCounterState.value.menuList,
    toPath,
    path: path.value
}